﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display {
    import flash.display.*;
    import flash.utils.*;

    public class MiniMarket extends Market {

        private var m_itemNameList:Array;

        public function MiniMarket(_arg1:Array, _arg2:String="unknown", _arg3:String="tool"){
            super(_arg2, _arg3);
            m_showLimitedIcons = false;
            this.m_itemNameList = _arg1;
        }
        override protected function onLoadComplete():void{
            super.onLoadComplete();
            this.hideButtons();
            fixArrows();
        }
        override protected function pushNewData(_arg1:String, _arg2:String="all"):void{
            var _local3:Object;
            super.pushNewData(_arg1, _arg2);
            var _local4:int;
            while (_local4 < m_data.length) {
                _local3 = (m_data[_local4] as Object);
                if (!this.isInItemList(_local3.name)){
                    m_data.splice(_local4, 1);
                    _local4--;
                };
                _local4++;
            };
        }
        private function isInItemList(_arg1:String):Boolean{
            var _local2:Boolean;
            var _local3:int;
            while (_local3 < this.m_itemNameList.length) {
                if (this.m_itemNameList[_local3] == _arg1){
                    _local2 = true;
                    break;
                };
                _local3++;
            };
            return (_local2);
        }
        private function hideButtons():void{
            var _local2:MovieClip;
            var _local4:GenericButton;
            var _local7:XML;
            var _local8:String;
            var _local1:XMLList = Global.gameSettings.getMenuItems();
            var _local3 = 1;
            var _local5:int;
            while (_local5 < _local1.length()) {
                _local7 = _local1[_local5];
                _local2 = m_window[(("cat" + _local3) + "_bt")];
                _local3++;
                if (_local2 != null){
                    _local2.visible = false;
                    _local4 = topButtons[_local7.@type];
                    _local4.disabled = true;
                };
                _local5++;
            };
            m_allCurrentSubTypes = Global.gameSettings.getSubMenuItemsByMenuType(m_currentType);
            var _local6 = 1;
            while (_local6 <= NUM_SUBSLOTS) {
                _local8 = (("subcat" + _local6) + "_bt");
                _local2 = (m_window[_local8] as MovieClip);
                _local2.visible = false;
                _local4 = (subcatButtons[_local8] as GenericButton);
                _local4.disabled = true;
                _local6++;
            };
        }

    }
}//package Display 
